
</script>
<div class="task1">
    <?php
    foreach ($edit->result() as $rows) {
        echo form_open('attendance/edit/' . $this->uri->segment('3'));
        echo '<div class="form-wrapper">';
        echo '<fieldset style="margin: 0 auto;width:60%;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
        echo '<legend align="center"><div class="heading" style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 20px;color:#006600;">Edit Teacher</div></legend>';
        echo '<div style="float: right; border: 0px #ccc solid;">';
        echo anchor('attendance/manager', img('images/user_images/cancel.png'));
        echo '</div>';
        echo '<table  align="center" width="auto">';
        echo '<tr>';
        echo '<td valign="top">Student Name &nbsp;<span>*</span>&nbsp;</td>';
//dropdown form test

        echo '<td>';
        echo '<select name="student_name">';
        $this->db->select('*');
        $selectdata = $this->db->get('tbl_student');
        echo '<option value="">-please select-</option>';

        foreach ($selectdata->result() as $row) {
            $sel_student = ($rows->stu_id == $row->stu_id) ? ' selected="selected"' : $row->stu_name . '';
            echo'<option value="' . $row->stu_id . '"' . $sel_student . '>' . $row->stu_name . '</option>';
        }
        echo '</select>';
        echo '</td>';
        echo '</td>';
        echo '</tr>';
        /* ---------------------- */
        echo '<tr>';
        echo '<td valign="top">Teacher Name&nbsp;<span>*</span></td>';
        echo ' <td>';
        echo '<select name="teacher_name">';
        echo '<option value="">-PleaseSelect--</option>';
        $this->db->select('*');
        $selectdata = $this->db->get('tbl_teacher');
        foreach ($selectdata->result() as $row) {
            $sel = ($rows->teacher_id == $row->tea_id) ? ' selected="selected"' : '';
            echo'<option value="' . $row->tea_id . '"' . $sel . '>' . $row->tea_name . '</option>';
        }
        echo '</select>';
        echo'</td>';
        echo'</tr>';
        /* ---------------------- */
        echo '<tr>';
        echo '<td valign="top">Class Name &nbsp;<span>*</span>&nbsp;</td>';
        echo '<td>';
        echo '<select name="class_name">';
//$this->db->select('*');
        $selectdata = $this->db->get('tbl_class');
        echo '<option value="">-please select-</option>';
        foreach ($selectdata->result() as $row3) {
            $sel_class = ($rows->cla_id == $row3->cla_id) ? ' selected="selected"' : '';
            echo'<option value="' . $row3->cla_id . '"' . $sel_class . '>' . $row3->cla_name . '</option>';
            // echo $rows->cla_id; die();
        }
        echo '</select>';
        echo '</td>';
        echo '</tr>';
        /* ---------------------- */
        echo '<tr>';
        echo '<td valign="top">Date &nbsp;<span>*</span>&nbsp;</td>';
        ?>
        <td>: <input type="text" name="txtdate" class="datepicker"  value="<?php echo $rows->att_date ?>" /><?php echo form_error('txtdate'); ?></td> 
            <?php
            echo '</td>';
            echo '</tr>';

            echo '<tr>';
            echo '<td valign="top">Class Time &nbsp;<span>*</span>&nbsp;</td>';
            echo '<td>' . form_input(array('name' => 'txtdrop', 'value' => $rows->att_time)) . '</td>';
            echo '</td>';
            echo '</tr>';
            /* ---------------------- */
            echo '<tr>';
            echo '<td  width="40%">';
            echo '</fieldset>';
            echo '<fieldset style=" float:right; margin: 0 auto;width:86%;height: 50px;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
            echo '<legend align="center"><div style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 11px;color:#006600;">Card Type</div></legend>';
            echo '<div cellspacing:5px;>';
            echo form_radio(array('name' => 'card', 'value' => '1')) . '1&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'card', 'value' => '4')) . '4&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'card', 'value' => '1month')) . '1 month&nbsp;&nbsp;&nbsp;<br /><br />';
            echo form_radio(array('name' => 'card', 'value' => '10 class')) . '10 Class&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'card', 'value' => '20 class')) . '20 Class&nbsp;&nbsp;&nbsp;';
            echo '</div>';
            echo '</fieldset>';
            echo'</td>';
            echo '<td width="40%">';
            echo '<fieldset style="float:left; margin: 0 auto;width:86%;height: 50px;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
            echo '<legend align="center"><div style="margin: 0 auto;width: 100%;height: auto;border: 0px #ccc solid;text-align: center;font-size: 11px;color:#006600;">Student Type</div></legend>';
            echo '<div style="text-align:center;">';
            echo form_radio(array('name' => 'student', 'value' => 'V')) . 'V&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'student', 'value' => 'K')) . 'K&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'student', 'value' => 'T')) . 'T&nbsp;&nbsp;&nbsp;';
            echo form_radio(array('name' => 'student', 'value' => 'TCM')) . 'TCM&nbsp;&nbsp;&nbsp;<br/><br/>';
            echo '</div>';
            echo '</td>';
            echo '</tr>';

            /* ---------------------- */
            echo '<tr>';
            echo '<td></td>';
            echo '<td>' . form_submit('btn_submit', 'Update') . form_reset('btn_reset', 'Reset') . '</td>';
            echo '</tr>';
            echo '</table>';
            echo '</fieldset>';
            echo '</div>';
            echo form_close();
        }
        ?>
</div>